package main

import (
	"fmt"
	"strconv"
)

func maximum69Number(num int) int {

	ns := strconv.Itoa(num)
	var news []byte
	find := false

	for _, v := range ns {
		if find {
			news = append(news, byte(v))
			continue
		}
		if string(v) == "6" {
			news = append(news, '9')
			find = true
		} else {
			news = append(news, byte(v))
		}
	}

	fmt.Println("result: ", string(news))

	r, _ := strconv.Atoi(string(news))

	return r
}
